package com.apes.enquiry.product.model;


import com.apes.framework.jpa.DefaultPersistListener;
import com.apes.framework.jpa.Model;
import com.apes.framework.jpa.comment.Comment;
import com.apes.framework.jpa.generator.ApesGenerator;
import com.apes.framework.util.ApesConst;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.SelectBeforeUpdate;

import javax.persistence.*;

/**
 * 类描述：轮胎扩展表
 *
 * @ClassName TyreExtend
 * @Description 描述
 * @Author lilong
 * @Date 2022/10/31 9:40
 * @Version 1.0
 */

@Getter
@Setter
@SelectBeforeUpdate
@DynamicInsert
@DynamicUpdate
@Entity
@EntityListeners(DefaultPersistListener.class)
@Table(name = TyreProduct.CONST_TABLE_NAME)
public class TyreProduct extends Model {
    public static final String CONST_TABLE_NAME = "sp_mas_tyre_product";
    @Id
    @Column(name = "id", length = 6)
    @ApesGenerator(code = CONST_TABLE_NAME, name = "轮胎商品")
    @Comment("编码")
    private String id;


    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "sp_id", referencedColumnName = "id")
    @Comment("商品列表")
    private SpProduct spProduct;


    @Column(name = "specification", length = 100)
    @Comment("规格")
    private String specification;

    @Column(name = "figure", length = 100)
    @Comment("花纹")
    private  String figure;

    @Column(name = "load_index",columnDefinition = ApesConst.FIELD_MONEY_16_4_0)
    @Comment("载重指数")
    private String loadIndex;

    @Column(name = "speed_class", length = 100)
    @Comment("速度等级")
    private String speedClass;

    @Column(name = "anti_explosion", columnDefinition = "number(1,0) default 0")
    @Comment("是否防爆")
    private boolean antiExplosion;




}
